﻿using Furion.CMS.Core;
using Furion.CMS.Core.Helper;
using Furion.CMS.Domain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Furion.CMS.Application.Dto
{
    /// <summary>
    /// 网站配置数据传输对象
    /// </summary>
    public class SiteSettingsDto
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        public SiteSettingsDto()
        {
            var modeList = EnumHelper.GetValues<StorageMode>();

            StorageModeList = new object[modeList.Count(), 2];

            for (int i = 0; i < modeList.Count(); i++)
            {
                var mode = modeList.ElementAt(i);
                StorageModeList.SetValue((int)mode, i, 0);
                StorageModeList.SetValue(mode.GetDescription(), i, 1);
            }
        }

        /// <summary>
        /// 站点配置数据Id
        /// </summary>
        public int Id { get; set; }
        /// <summary>
        /// 网站名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 网站标题
        /// </summary>
        public string Title { get; set; }
        /// <summary>
        /// 网站Logo
        /// </summary>
        public string Logo { get; set; }
        /// <summary>
        /// 网站访问地址
        /// </summary>
        public string HostUrl { get; set; }
        /// <summary>
        /// 网站关键词
        /// </summary>
        public string Keywords { get; set; }
        /// <summary>
        /// 网站描述
        /// </summary>
        public string Description { get; set; }
        /// <summary>
        /// 网站版权信息
        /// </summary>
        public string Copyright { get; set; }
        /// <summary>
        /// 是否启用安全锁定
        /// </summary>
        public bool IsSafeLock { get; set; }
        /// <summary>
        /// 安全锁定时长
        /// </summary>
        public int SafeLockDuration { get; set; }
        /// <summary>
        /// 安全验证最大失败次数
        /// </summary>
        public int SafeVerifyMaxFialNumber { get; set; }
        /// <summary>
        /// 是否启用登录验证码
        /// </summary>
        public bool IsLoginCaptcha { get; set; }
        /// <summary>
        /// 是否启用双因素验证
        /// </summary>
        public bool IsTwoFactorVerify { get; set; }
        /// <summary>
        /// 是否启用手机号登录验证
        /// </summary>
        public bool IsPhoneNumberLogin { get; set; }
        /// <summary>
        /// 验证码有效时长
        /// </summary>
        public int CaptchaDuration { get; set; }
        /// <summary>
        /// 对象存储模式
        /// </summary>
        public int ObjectStorageMode { get; set; }
        /// <summary>
        /// 存储模式列表
        /// </summary>
        public object[,] StorageModeList { get; set; }
        /// <summary>
        /// 对象存储库地址
        /// </summary>
        public string StorageHostUrl { get; set; }
        /// <summary>
        /// 对象存储库接入key
        /// </summary>
        public string StorageAccessKey { get; set; }
        /// <summary>
        /// 对象存储库接入KeySecret
        /// </summary>
        public string StorageAccessKeySecret { get; set; }
    }
}
